function fin_timer(){
	examen.enviarExamen();
}

function display_c(start){
	start = parseFloat(start);
	var end = 0 // change this to stop the counter at a higher value
	var refresh=1000; // Refresh rate in milli seconds
	if(start >= end ) {
		mytime=setTimeout('display_ct(' + start + ')',refresh)
	}
	else {
		fin_timer();
	}
}		
		
function display_ct(start) {
	// Calculate the number of days left
	var days=Math.floor(start / 86400);
	// After deducting the days calculate the number of hours left
	var hours = Math.floor((start - (days * 86400 ))/3600)
	// After days and hours , how many minutes are left
	var minutes = Math.floor((start - (days * 86400 ) - (hours *3600 ))/60)
	// Finally how many seconds left after removing days, hours and minutes.
	var secs = Math.floor((start - (days * 86400 ) - (hours *3600 ) - (minutes*60)))

	if (minutes < 10) {
		minutes = "0" + minutes;
	}
	if (secs < 10){
		secs = "0" + secs;
	}
	
	var x = hours + ":" + minutes + ":" + secs;
	
	document.getElementById('cdtime').innerHTML = x;
	start= start- 1;
	
	tt=display_c(start);
}

